package com.xxx.corejava.day1216;

import javax.swing.*;
import java.awt.*;

public class TestJPanel {

    public static void main(String[] args) {
        JFrame jf=new JFrame();


        jf.setLayout(new BorderLayout());

        JTextField jtf=new JTextField(10);

        jf.add(jtf,BorderLayout.NORTH);

        JPanel jp=new JPanel();

        jp.setLayout(new GridLayout(5,4,6,6));

        for (int i = 0; i < 20; i++) {
            jp.add(new JButton(i+""));
        }

        jf.add(jp);


        jf.setSize(300,200);
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
